summaryrefslogtreecommitdiff
path: root/app/[lng]/evcp/pq/[vendorId]/page.tsx
blob: cb4277f1e8d64d1fe7b53ea7308dc78d0f45c441 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import * as React from "react"
import { Shell } from "@/components/shell"
import { Skeleton } from "@/components/ui/skeleton"

import { type SearchParams } from "@/types/table"
import { getPQDataByVendorId } from "@/lib/pq/service"
import { DataTableSkeleton } from "@/components/data-table/data-table-skeleton"
import { Vendor } from "@/db/schema/vendors"
import { findVendorById } from "@/lib/vendors/service"
import VendorPQReviewPage from "@/components/pq/pq-review-detail"
import VendorPQAdminReview from "@/components/pq/pq-review-detail"

interface IndexPageProps {
    params: {
        vendorId: string  // Updated from 'id' to 'contractId' to match route parameter
    }
    searchParams: Promise<SearchParams>
}

export default async function DocumentListPage(props: IndexPageProps) {
    const resolvedParams = await props.params
    const vendorId = resolvedParams.vendorId  // Updated from 'id' to 'contractId'

    const idAsNumber = Number(vendorId)

    const data = await getPQDataByVendorId(idAsNumber)

    const vendor: Vendor | null = await findVendorById(idAsNumber)

    // 4) 렌더링
    return (
        <Shell className="gap-2">
            {vendor &&
                <VendorPQAdminReview data={data} vendor={vendor} />
            }
        </Shell>
    )
}